#ifndef __HUD_H__
#define __HUD_H__

#include <osgDB/ReadFile>

#include <osg/Geode>
#include <osg/BlendFunc>
#include <osg/Depth>
#include <osg/MatrixTransform>
#include <osg/Camera>

#include <osgText/Text>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

class Hud{
private:
	osg::ref_ptr<osg::Camera> m_pcam;
	osg::ref_ptr<osg::Geode> m_pgeode;
	osg::ref_ptr<osg::Geometry> geomJaugeFront;
	osg::ref_ptr<osg::Vec3Array> recJauge;
	osg::ref_ptr<osg::Geometry> geomPopup;
	osg::ref_ptr<osgText::Text> popupTxt;
	double jaugeLevel;

	void initCam();
	void drawText(osg::Vec3 pos, char* txt);
	void drawPics(std::string fileName, osg::Vec3 pos);
	void drawBackground();
public:
	Hud();
	void update();
	osg::ref_ptr<osg::Camera> getCamHud();
	osg::ref_ptr<osg::Geometry> drawRectangle(osg::Vec3 pos, float width, float height, osg::Vec4 color);
	void setJaugeLevel(double level);// incremnt by level (usually 0.02)
	void pause();
	void endGame(std::string msg);
	
	inline osg::ref_ptr<osg::Geode> getGeode(){return m_pgeode;}
};

#endif // __HUD_H__

